package com.macro.mall.ums.service.withdraw;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.macro.mall.ums.domain.MemberWithdrawLog;
import com.macro.mall.ums.entity.MemberWithdrawLogEntity;
import com.macro.mall.ums.enums.MemberWithdrawLogExportStatusEnum;
import com.macro.mall.ums.enums.MemberWithdrawLogStatusEnum;
import com.macro.mall.ums.service.withdraw.bo.InsertMemberWithdrawLogInput;
import com.macro.mall.ums.service.withdraw.bo.PagedQueryMemberWithdrawLogInput;
import com.macro.mall.ums.service.withdraw.bo.UpdateMemberWithdrawLogInput;

import java.util.List;

/**
 * 会员提现记录Service
 *
 * @author xuyanjun
 * @date 2019-12-28
 */
public interface MemberWithdrawLogService extends IService<MemberWithdrawLogEntity> {

    /**
     * 提现
     *
     * @param userId 用户id
     * @param amount 提现金额
     */
    void withdraw(long userId, int amount, String alipayAccount, String alipayRealname);

    /**
     * 新增会员提现记录
     *
     * @param input input
     * @return 新增id
     */
    long insert(InsertMemberWithdrawLogInput input);

    /**
     * 修改会员提现记录
     *
     * @param input input
     */
    void update(UpdateMemberWithdrawLogInput input);

    /**
     * 删除会员提现记录
     *
     * @param id id
     */
    void delete(long id);

    /**
     * 根据Id获取会员提现记录
     *
     * @param id id
     * @return 会员提现记录
     */
    MemberWithdrawLog getById(long id);

    /**
     * 根据批量Id获取会员提现记录
     *
     * @param batchIds 批量ids
     * @return 会员提现记录集合
     */
    List<MemberWithdrawLogEntity> listByBatchIds(List<Long> batchIds);

    /**
     * 分页查询
     *
     * @param input input
     * @return 分页的会员提现记录
     */
    PageInfo<MemberWithdrawLog> pagedQuery(PagedQueryMemberWithdrawLogInput input);


    List<MemberWithdrawLogEntity> listByStatusAndExportStatus(MemberWithdrawLogStatusEnum statusEnum, MemberWithdrawLogExportStatusEnum exportStatusEnum);

    /**
     * 将实体对象转换成domain对象
     *
     * @param memberWithdrawLogEntity 实体
     * @return memberWithdrawLog
     */

    MemberWithdrawLog entityToDomain(MemberWithdrawLogEntity memberWithdrawLogEntity);

    /**
     * 将实体对象转换成domain对象
     *
     * @param memberWithdrawLogEntities 实体
     * @return memberWithdrawLog
     */
    List<MemberWithdrawLog> entityToDomain(List<MemberWithdrawLogEntity> memberWithdrawLogEntities);
}